/**
 * 直接用数组的反转
 * @param {*} str
 * @returns
 */
function reverseStr(str) {
  if (str === "") return "";

  return str.split("").reverse().join("");
}

// egg

let str = "the girl in the mirror";
console.log(reverseStr(str));
